// Decompiled by Jad v1.5.8g. Copyright 2001 Pavel Kouznetsov.
// Jad home page: http://www.kpdus.com/jad.html
// Decompiler options: packimports(3) 

package com.nnee.p_pr.p_activity;

import android.content.Context;
import android.content.Intent;
import android.os.Bundle;
import android.view.KeyEvent;
import android.view.LayoutInflater;
import android.view.Menu;
import android.view.MenuInflater;
import android.view.MenuItem;
import android.view.View;
import android.widget.BaseAdapter;
import android.widget.Button;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.ProgressBar;
import android.widget.TextView;
import android.widget.Toast;
import com.nnee.p_fk.cls_ActivityEx;
import com.nnee.p_fk.cls_k;
import com.nnee.p_img.cls_c;
import com.nnee.p_pr.p_activity.p_a.cls_af;
import com.nnee.p_pr.p_activity.p_a.cls_g;
import com.nnee.p_pr.p_activity.p_a.cls_t;
import com.nnee.p_pr.p_activity.p_view.cls_NPullToFreshContainer;
import com.nnee.p_pr.p_activity.p_view.cls_NeteaseGridView;
import com.nnee.p_pr.p_activity.p_view.cls_NeteaseListView;
import com.nnee.p_pr.p_activity.p_view.cls_bn;
import com.nnee.p_pr.p_app.cls_PrisApp;
import com.nnee.p_pr.p_atom.cls_b;
import com.nnee.p_pr.p_atom.cls_u;
import com.nnee.p_pr.p_prot.cls_d;
import com.nnee.p_pr.cls_v;
import java.util.LinkedList;

// Referenced classes of package com.nnee.p_pr.p_activity:
//            ah, af, ag, ad, 
//            ae, SubsInfoActivity

public class cls_SubsSourceActivity extends cls_ActivityEx
{

    public cls_SubsSourceActivity()
    {
        j = false;
        k = false;
        l = 0;
        m = 0;
        n = null;
        o = null;
        p = null;
        q = null;
        r = null;
        s = null;
        t = null;
        u = null;
        x = null;
        M = null;
        e = true;
        f = new cls_ah(this);
        g = new com.nnee.p_pr.p_activity.cls_af(this);
        N = new cls_ag(this);
        h = new cls_ad(this);
        i = new cls_ae(this);
    }

    static Toast a(cls_SubsSourceActivity paramSubsSourceActivity1)
    {
        return paramSubsSourceActivity1.K;
    }

    static Toast a(cls_SubsSourceActivity paramSubsSourceActivity1, Toast toast)
    {
    	paramSubsSourceActivity1.K = toast;
        return toast;
    }

    static cls_u func_a(cls_SubsSourceActivity paramSubsSourceActivity1, cls_u u1)
    {
    	paramSubsSourceActivity1.p = u1;
        return u1;
    }

    static cls_d a(cls_SubsSourceActivity paramSubsSourceActivity1, cls_d d1)
    {
    	paramSubsSourceActivity1.q = d1;
        return d1;
    }

    static String a(cls_SubsSourceActivity paramSubsSourceActivity1, String s1)
    {
    	paramSubsSourceActivity1.o = s1;
        return s1;
    }

    private void a(int i1, Object obj, String s1, String s2, boolean flag)
    {
        cls_b b1;
        b1 = cls_b.aNormal;
        if(p != null)
            b1 = p.be();
        switch(i1)
        {
        case 901:
        	l = com.nnee.p_pr.cls_v.a().a(s1, b1, p, flag);
        	break;
        
        case 903:
        	l = com.nnee.p_pr.cls_v.a().c(s1, b1);
        	break;
        case 902:
        	default:
        		 return;
        		 
        }
        z.add(new Integer(l));
    }

    public static void a(Context context, String s1, cls_u u1)
    {
        cls_PrisApp.a().a(u1);
        Intent intent = new Intent(context, com.nnee.p_pr.p_activity.cls_SubsSourceActivity.class);
        intent.putExtra("url", s1);
        context.startActivity(intent);
    }

    static void a(cls_SubsSourceActivity paramSubsSourceActivity1, int i1, Object obj, String s1, String s2, boolean flag)
    {
    	paramSubsSourceActivity1.a(i1, obj, s1, s2, flag);
    }

    static void a(cls_SubsSourceActivity paramSubsSourceActivity1, cls_d d1, boolean flag)
    {
    	paramSubsSourceActivity1.a(d1, flag);
    }

    static void a(cls_SubsSourceActivity paramSubsSourceActivity1, boolean flag)
    {
    	paramSubsSourceActivity1.c(flag);
    }

    private void a(cls_d d1, boolean flag)
    {
        if(d1 != null && d1.h != null) {
        	switch(p.av())
            {
            case 256: 
                if(x != null && (x instanceof cls_t))
                    if(flag)
                    {
                        y.addAll(d1.h);
                        ((cls_t)x).a(d1.h);
                        x.notifyDataSetChanged();
                    } else
                    {
                        y.clear();
                        y.addAll(d1.h);
                        ((cls_t)x).a();
                        ((cls_t)x).b(d1.h);
                        t.setSelection(t.getHeaderViewsCount());
                        x.notifyDataSetChanged();
                    }
                break;

            case 1024: 
                if(x != null && (x instanceof cls_af))
                    if(flag)
                    {
                        y.addAll(d1.h);
                        x.notifyDataSetChanged();
                    } else
                    {
                        y.clear();
                        y.addAll(d1.h);
                        t.setAdapter(x);
                        t.setSelection(t.getHeaderViewsCount());
                    }
                break;

            case 512: 
                if(x != null && (x instanceof cls_g))
                    if(flag)
                    {
                        y.addAll(d1.h);
                        x.notifyDataSetChanged();
                    } else
                    {
                        y.clear();
                        y.addAll(d1.h);
                        u.setAdapter(x);
                    }
                break;

            case 2048: 
                if(x != null && (x instanceof  com.nnee.p_pr.p_activity.p_a.cls_b))
                    if(flag)
                    {
                        y.addAll(d1.h);
                        x.notifyDataSetChanged();
                    } else
                    {
                        y.clear();
                        y.addAll(d1.h);
                        u.setAdapter(x);
                    }
                break;
            }
        }
    }

    static void b(cls_SubsSourceActivity paramSubsSourceActivity1)
    {
    	paramSubsSourceActivity1.h();
    }

    static void b(cls_SubsSourceActivity paramSubsSourceActivity1, boolean flag)
    {
    	paramSubsSourceActivity1.b(flag);
    }

    private void b(boolean flag)
    {
        if(flag)
        {
            H.setVisibility(0);
            I.setText(0x7f0a009d);
        } else
        {
            H.setVisibility(8);
        }
    }

    static cls_u c(cls_SubsSourceActivity paramSubsSourceActivity1)
    {
        return paramSubsSourceActivity1.p;
    }

    private void c()
    {
        s = (ImageView)findViewById(0x7f0d0008);
        w = (cls_NPullToFreshContainer)findViewById(0x7f0d00fc);
        t = (cls_NeteaseListView)findViewById(0x7f0d0081);
        w.a(f);
        u = (cls_NeteaseGridView)findViewById(0x7f0d00ff);
        v = (cls_NPullToFreshContainer)findViewById(0x7f0d00fe);
        v.a(f);
        A = LayoutInflater.from(this).inflate(0x7f030008, null);
        t.addFooterView(A);
        t.setDivider(null);
        t.setDividerHeight(0);
        t.setFooterDividersEnabled(false);
        B = (LinearLayout)A.findViewById(0x7f0d001a);
        C = (ProgressBar)A.findViewById(0x7f0d001b);
        D = (TextView)A.findViewById(0x7f0d001c);
        F = (LinearLayout)A.findViewById(0x7f0d001d);
        G = (Button)A.findViewById(0x7f0d0020);
        E = (ProgressBar)findViewById(0x7f0d000c);
        H = (LinearLayout)findViewById(0x7f0d0100);
        I = (TextView)findViewById(0x7f0d0102);
        J = (LinearLayout)findViewById(0x7f0d00fd);
        L = findViewById(0x7f0d00fb);
    }

    static void c(cls_SubsSourceActivity paramSubsSourceActivity1, boolean flag)
    {
    	paramSubsSourceActivity1.d(flag);
    }

    private void c(boolean flag)
    {
        if(flag)
        {
            B.setVisibility(0);
            C.setVisibility(0);
            D.setText(0x7f0a009d);
        } else
        {
            B.setVisibility(8);
        }
    }

    static cls_NPullToFreshContainer d(cls_SubsSourceActivity paramSubsSourceActivity1)
    {
        return paramSubsSourceActivity1.v;
    }

    private void d(boolean flag)
    {
        if(flag)
            F.setVisibility(0);
        else
            F.setVisibility(8);
    }

    static boolean d(cls_SubsSourceActivity paramSubsSourceActivity1, boolean flag)
    {
    	paramSubsSourceActivity1.j = flag;
        return flag;
    }

    static cls_NPullToFreshContainer e(cls_SubsSourceActivity paramSubsSourceActivity1)
    {
        return paramSubsSourceActivity1.w;
    }

    private void e()
    {
        setTitle(p.U());
        f(0x7f02013a);
        s.setVisibility(8);
        E.setVisibility(0);
    }

    static ImageView f(cls_SubsSourceActivity paramSubsSourceActivity1)
    {
        return paramSubsSourceActivity1.s;
    }

    private void f()
    {
        switch(p.av())
        {
        case 256:
        	String as[] = new String[5];
            as[0] = "icon";
            as[1] = "title";
            as[2] = "time";
            as[3] = "content";
            as[4] = "line";
            int ai[] = new int[4];
            ai[0] = 0x7f0d0024;
            ai[1] = 0x7f0d0018;
            ai[2] = 0x7f0d0104;
            ai[3] = 0x7f0d007d;
            x = new cls_t(this, 0x7f030046, as, ai);
            t.setAdapter(x);
            w.setVisibility(0);
            t.setVisibility(0);
            u.setVisibility(8);
        	break;
        case 512:
        	J.setBackgroundColor(com.nnee.p_fk.cls_k.a(this).c(0x7f0800ac));
            cls_g g1 = new cls_g(this);
            u.setAdapter(g1);
            g1.a(y);
            x = g1;
            int k1 = com.nnee.p_img.cls_c.a(r, 8F);
            u.setVerticalSpacing(k1);
            int l1 = com.nnee.p_img.cls_c.a(r, 8F);
            u.setHorizontalSpacing(l1);
            u.setPadding(l1, 0, l1, 0);
            u.setSelector(0x7f0200f8);
            w.setVisibility(8);
            t.setVisibility(8);
            u.setVisibility(0);
        	break;
        case 1024:
        	cls_af af1 = new cls_af(this);
            af1.a(y);
            x = af1;
            t.setAdapter(x);
            w.setVisibility(0);
            t.setVisibility(0);
            u.setVisibility(8);
        	break;
        case 2048:
        	com.nnee.p_pr.p_activity.p_a.cls_b b1 = new com.nnee.p_pr.p_activity.p_a.cls_b(this);
            u.setAdapter(b1);
            b1.a(y);
            x = b1;
            int i1 = com.nnee.p_img.cls_c.a(r, 16F);
            u.setVerticalSpacing(i1);
            int j1 = com.nnee.p_img.cls_c.a(r, 12F);
            u.setHorizontalSpacing(j1);
            u.setPadding(j1, 0, j1, 0);
            u.setSelector(0x7f02007b);
            t.setVisibility(8);
            w.setVisibility(8);
            u.setVisibility(0);
        	break;
        default:
        	 return;
        	 
        }
        
    }

    static ProgressBar g(cls_SubsSourceActivity paramSubsSourceActivity1)
    {
        return paramSubsSourceActivity1.E;
    }

    private void g()
    {
        if(s != null)
            s.setOnClickListener(g);
        if(G != null)
            G.setOnClickListener(g);
        if(t != null)
        {
            t.setOnItemClickListener(N);
            t.setOnScrollListener(h);
        }
        if(u != null)
        {
            u.setOnItemClickListener(N);
            u.setOnScrollListener(h);
        }
    }

    static LinkedList h(cls_SubsSourceActivity paramSubsSourceActivity1)
    {
        return paramSubsSourceActivity1.y;
    }

    private void h()
    {
        s.setVisibility(8);
        E.setVisibility(0);
        d(false);
        j = true;
        a(901, null, n, null, false);
    }

    static String i(cls_SubsSourceActivity paramSubsSourceActivity1)
    {
        return paramSubsSourceActivity1.n;
    }

    static String j(cls_SubsSourceActivity paramSubsSourceActivity1)
    {
        return paramSubsSourceActivity1.o;
    }

    static BaseAdapter k(cls_SubsSourceActivity paramSubsSourceActivity1)
    {
        return paramSubsSourceActivity1.x;
    }

    static Context l(cls_SubsSourceActivity paramSubsSourceActivity1)
    {
        return paramSubsSourceActivity1.r;
    }

    static LinearLayout m(cls_SubsSourceActivity paramSubsSourceActivity1)
    {
        return paramSubsSourceActivity1.F;
    }

    static boolean n(cls_SubsSourceActivity paramSubsSourceActivity1)
    {
        return paramSubsSourceActivity1.j;
    }

    static void o(cls_SubsSourceActivity paramSubsSourceActivity1)
    {
    	paramSubsSourceActivity1.r();
    }

    static View p(cls_SubsSourceActivity paramSubsSourceActivity1)
    {
        return paramSubsSourceActivity1.L;
    }

    static LinkedList q(cls_SubsSourceActivity paramSubsSourceActivity1)
    {
        return paramSubsSourceActivity1.z;
    }

    static cls_d r(cls_SubsSourceActivity paramSubsSourceActivity1)
    {
        return paramSubsSourceActivity1.q;
    }

    private void r()
    {
        if(o != null && !j)
        {
            j = true;
            a(903, null, o, null, false);
            c(true);
            b(true);
            s.setVisibility(8);
            E.setVisibility(0);
        }
    }

    static String s(cls_SubsSourceActivity paramSubsSourceActivity1)
    {
        return paramSubsSourceActivity1.M;
    }

    static cls_NeteaseListView t(cls_SubsSourceActivity paramSubsSourceActivity1)
    {
        return paramSubsSourceActivity1.t;
    }

    void a()
    {
        e = false;
    }

    void b()
    {
        e = true;
    }

    protected void onActivityResult(int i1, int j1, Intent intent)
    {
        switch(i1)
        {
        case 4096:
        	if(j1 == -1 && intent != null)
            {
                Bundle bundle = intent.getExtras();
                if(bundle != null)
                {
                    m = bundle.getInt("position");
                    o = bundle.getString("nexturl");
                    k = true;
                }
            }
        	break;
        	default:
        		return;
        }
        
    }

    public void onCreate(Bundle bundle)
    {
        super.onCreate(bundle);
        Intent intent = getIntent();
        if(intent != null)
            n = intent.getStringExtra("url");
        p = cls_PrisApp.a().q();
        setContentView(0x7f030044);
        r = this;
        y = new LinkedList();
        z = new LinkedList();
        com.nnee.p_pr.cls_v.a().a(i);
        c();
        f();
        g();
        e();
        j = true;
        a(901, null, n, null, true);
        M = getString(0x7f0a01fa);
    }

    public boolean onCreateOptionsMenu(Menu menu)
    {
        getMenuInflater().inflate(0x7f0c0008, menu);
        return super.onCreateOptionsMenu(menu);
    }

    public void onDestroy()
    {
        super.onDestroy();
        com.nnee.p_pr.cls_v.a().b(i);
        if(i != null)
        {
            i.c();
            i = null;
        }
        if(E != null)
            E.setVisibility(8);
        if(C != null)
            C.setVisibility(8);
        if(x != null)
        {
            if(x instanceof cls_t)
                ((cls_t)x).a();
            x = null;
        }
        if(q != null)
            q = null;
        if(y != null)
        {
            y.clear();
            y = null;
        }
        if(z != null)
        {
            z.clear();
            z = null;
        }
        if(g != null)
            g = null;
        if(h != null)
            h = null;
        if(N != null)
            N = null;
        if(t != null)
            t = null;
        if(u != null)
            u = null;
        if(D != null)
            D = null;
        if(s != null)
            s = null;
        if(K != null)
        {
            K.cancel();
            K = null;
        }
        n = null;
        o = null;
        p = null;
        B = null;
        H = null;
        F = null;
        I = null;
        G = null;
        r = null;
        com.nnee.p_img.cls_d.a().e();
    }

    public boolean onKeyDown(int i1, KeyEvent keyevent)
    {
        if(i1 == 4)
            com.nnee.p_pr.p_d.cls_c.a(p(), 1714);
        return super.onKeyDown(i1, keyevent);
    }

    public boolean onOptionsItemSelected(MenuItem menuitem)
    {
        switch(menuitem.getItemId())
        {
        case 2131558722:
        	int i1 = p.av();
            a();
            if(i1 == 512 || i1 == 2048)
                v.a();
            else
                w.a();
            b();
            com.nnee.p_pr.p_d.cls_c.a(p(), 1715, "Menu");
        	break;
        case 2131558734:
        	 cls_SubsInfoActivity.a(r, p);
             com.nnee.p_pr.p_d.cls_c.a(p(), 1712);
        	break;
        default:
        	break;
        }
        return super.onOptionsItemSelected(menuitem);
        
    }

    public boolean onPrepareOptionsMenu(Menu menu)
    {
        menu.clear();
        getMenuInflater().inflate(0x7f0c0008, menu);
        if(menu.findItem(0x7f0d0142) != null)
        {
            MenuItem menuitem = menu.findItem(0x7f0d0142);
            boolean flag;
            if(!j)
                flag = true;
            else
                flag = false;
            menuitem.setEnabled(flag);
        }
        return super.onPrepareOptionsMenu(menu);
    }

    public void onResume()
    {int i1 =0;
    int j1 =0;
        super.onResume();
        if(!k || q == null) {
        	return;
        }else {
        	 k = false;
             if(-1 + m <= 0){
            	 i1 = m;
             } else {
            	   i1 = -1 + m;
            	   
            	   if(t == null) {
            		   j1 = i1;
            	   } else {
            		     j1 = i1 + t.getHeaderViewsCount();
            	   }
             }
             switch(p.av())
             {
             case 256:
            	 ((cls_t)x).a();
                 ((cls_t)x).b(q.h);
                 if(t != null)
                     t.setSelection(j1);
                 return;
            	 
             case 512:
             case 2048:
            	 y.clear();
                 y.addAll(q.h);
                 u.setAdapter(x);
                 u.setSelection(j1);
                 return;
             case 1024:
            	 y.clear();
                 y.addAll(q.h);
                 t.setAdapter(x);
                 t.setSelection(j1);
                 return;
            	 default:
            		 return;
             }
        }

    }

    public static final int a = 0;
    public static final int b = 1;
    public static final int c = 4096;
    public static final int d = 1;
    private View A;
    private LinearLayout B;
    private ProgressBar C;
    private TextView D;
    private ProgressBar E;
    private LinearLayout F;
    private Button G;
    private LinearLayout H;
    private TextView I;
    private LinearLayout J;
    private Toast K;
    private View L;
    private String M;
    private android.widget.AdapterView.OnItemClickListener N;
    boolean e;
    cls_bn f;
    android.view.View.OnClickListener g;
    android.widget.AbsListView.OnScrollListener h;
    com.nnee.p_pr.cls_b i;
    private boolean j;
    private boolean k;
    private int l;
    private int m;
    private String n;
    private String o;
    private cls_u p;
    private cls_d q;
    private Context r;
    private ImageView s;
    private cls_NeteaseListView t;
    private cls_NeteaseGridView u;
    private cls_NPullToFreshContainer v;
    private cls_NPullToFreshContainer w;
    private BaseAdapter x;
    private LinkedList y;
    private LinkedList z;
}
